<!DOCTYPE html>
<html>

<head>
  <%- include('head') %>
    <link rel="stylesheet" href="/stylesheets/manage.css">
</head>

<body>
  <div id="back">

  </div>
  <section class="section">
    <header>
      <h2 class="title">学生管理</h2>
    </header>
    <% if(message){%>
      <div><%= message%></div>
    <% } %>
    <% if(!status){%>
      
      <form action="/manage" method="post">
        <div id='manager'>
          <div class="field">
            <div class="control">
              <input class="input zxis-primary" name='username' type="text" placeholder="用户名">
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-info" name='password' type="password" placeholder="密码请输入身份证后六位">
            </div>
          </div>
          <button type="submit" class='button is-primary'>提交</button>
        </div>
      </form>
    <% }else{ %>
      <div class="container">
        <% var posobj = {'在校':'school','外出实习':'out-intern','回家':'home','旅游':'tour'}%>
        <div class="field">
          <div class="control">
            <div class="select">
              <select class="position">
                <option value="all">全部</option>
                <option value="<%= posobj['在校']%>">在校</option>
                <option value="<%= posobj['外出实习']%>">外出实习</option>
                <option value="<%= posobj['回家']%>">回家</option>
                <option value="<%= posobj['旅游']%>">旅游</option>
              </select>
            </div>
          </div>
        </div>
        <table class="table is-striped is-fullwidth">
          <thead>
            <tr>
              <th>#</th>
              <th>学号</th>
              <th>姓名</th>
              <th>人员状态</th>
            </tr>
          </thead>
          <tbody>
            <% for (var i=0;i<students.length;i++){%>
              <tr class='stu' data-value='<%- posobj[students[i].status] %>'>
                <td class="index">
                  <%- i+1%>
                </td>
                <td class="id">
                  <%- students[i].id%>
                </td>
                <td class="name">
                  <%- students[i].name%>
                </td>
                <td class="status">
                  <%- students[i].status%>
                </td>
              </tr>
            <% } %>
          </tbody>
        </table>
      </div>
    <% } %>
  </section>
</body>
<script src='/javascripts/manage.js'>
  
</script>

</html>